package com.wpedu.pattern.factory.simpleFactory;

import com.wpedu.pattern.factory.BenzCar;
import com.wpedu.pattern.factory.ICar;

/**
 * 汽车简单工厂
 *
 * @author Administrator
 * @create 2019 / 03 / 19 : 20:41
 **/
public class CarFactory {

    public ICar build(String carName) {
        if ("Benz".equals(carName)) {
            return new BenzCar();
        } else {
            return null;
        }
    }
}
